package com.test.thread;

import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;

/**
 * @Description:
 * @Author: yangzhiwei
 * @Date: 2021/6/29 10:19
 */
public class ThisEscape {
    public int getI() {
        return i;
    }

    public void setI(int i) {
        Semaphore semaphore;
        this.i = i;
    }

    private  int i;

    public ThisEscape() throws InterruptedException {
        new Thread( () -> {
            System.out.println(i);
        } ).start();

        TimeUnit.SECONDS.sleep(5);
        i = 5;

    }

    public static void main(String[] args) throws InterruptedException {
        ThisEscape escape = new ThisEscape();
    }
}
